package homework0309;

public class TryCatchDemo1 {
    public static void main(String[] args) {
        System.out.println("开始");
        try {
            String name =null;
            System.out.println(name.length());
        }catch (NullPointerException e){
            System.out.println("发现异常并已解决");
        }

        System.out.println("结束");
    }
}
